package online.heycm.platform.rocketmq.publisher;

import online.heycm.platform.common.entity.exception.BizException;
import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.client.producer.SendResult;

/**
 * 默认异步消息回调器
 *
 * @author heycm
 * @since 2023/12/2 20:47
 */
public class DefaultSendCallback implements SendCallback {

    @Override
    public void onSuccess(SendResult sendResult) {
        // do nothing.
    }

    @Override
    public void onException(Throwable throwable) {
        throwable.printStackTrace();
        BizException.biz(throwable.getMessage());
    }
}
